﻿using System;
using Microsoft.Extensions.Logging;
using Unity.Connections;
using Unity.Credentials;
using Unity.Logger;

namespace Unity.Debug
{
    public class ConsoleUnityConsumer : IUnityConsumer
    {
        private static readonly ILogger Logger = 
            UnityLogger.ConsoleLoggerFactory.CreateLogger(nameof(ConsoleUnityProducer));

        private readonly IUnityCredentials _credentials;
        private readonly IUnityCallback _callback;

        public ConsoleUnityConsumer(IUnityCredentials credentials, IUnityCallback callback)
        {
            _credentials = credentials;
            _callback = callback;
        }

        public void Dispose()
        {
            Logger.LogTrace("Call method Dispose");
            Close();
        }

        public bool Connect(IUnityCredentials credentials)
        {
            Logger.LogTrace("Call method Connect");
            return true;
        }

        public void Close()
        {
            Logger.LogTrace("Call method Close");
        }

        public byte[] Pull(int timeout)
        {
            Logger.LogTrace("Call method Pull");
            return Array.Empty<byte>();
        }
    }
}